﻿namespace CloudNinja.Metering.Web.Controllers
{
    using System.Linq;
    using System.Threading.Tasks;
    using System.Web.Http;

    using CloudNinja.Metering.Data;
    using CloudNinja.Metering.Data.Models;

    public class TotalResourceUsageController : MeteringODataController
    {
        public TotalResourceUsageController(IMeteringReporting meteringReporting)
            : base(meteringReporting)
        {
        }

        [Queryable]
        public async Task<IQueryable<TotalResourceUsage>> Get()
        {
            var result = await this.meteringReporting.GetTotalResourceUsageAsync();
            return result.AsQueryable();
        }
    }
}